const db = require('./db.js')
const bookModel = require('./modules/bookModule.js')
const movieModel = require('./modules/movieModel.js')
console.log('托尔斯泰')
db(() => {
		console.log('连接打开')

		//增加
		bookModel.create({
			name: '死了',
			author: '余华',
			is_hot: true,
			characters: ['刘备', '关羽', '张飞'],
			pub_time: new Date(),
			test: {
				name: '李四'
			},
		}).then((data => {
			console.log(data)
		}));
		movieModel.create({
			name: '泰坦尼克号',
			ticketPrice: 30
		}).then((data => {
			console.log(data)
		}))
	},
	() => {
		console.log('连接失败啦啦啦啦啦')
	}
)